export const mixin = {
	methods:{
		courseType(courseLevel){
			let value = ''
			switch (courseLevel){
				case 1:
					value='初级'
					break;
				case 2:
					value='中级'
					break;
				case 3:
					value='高级'
					break;
				default:
					break;
			}
			return value
		},
		courseNumber(value){
		},
		getHeigh(HeaderSearch,HomeTabs){
			let searchHeight = 0
			let tabsHeight = 0
			let height = 0
			
			if(HeaderSearch){
				//header-search高度
				let searchView = uni.createSelectorQuery().select(HeaderSearch)
				searchView.boundingClientRect(data=>{
					searchHeight = data.height
				}).exec()
			}
			if(HomeTabs){
				//home-tabs高度
				let tabsView = uni.createSelectorQuery().select(HomeTabs)
				tabsView.boundingClientRect(data=>{
					tabsHeight = data.height
				}).exec()
			}
			
			uni.getSystemInfo({
				success(res) {
					height = res.windowHeight - searchHeight - tabsHeight
				}
			})
			return height
		}
	}
}